package hypermediaresearch.controller.hypermedia;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
/*
 * VinhJune 2012
 */
import hypermediaresearch.model.Partner;
import hypermediaresearch.model.Project;
import hypermediaresearch.model.ProjectPartner;
import hypermediaresearch.service.PartnerService;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

public class Partner_presentationController extends Controller {

    private PartnerService service = new PartnerService();
    @Override
    public Navigation run() throws Exception {
        
        String name = requestScope("name");
        
        if (name != null){
            Partner partner = service.getPartnerByName(name);
            requestScope("partner", partner);
            
            List<Project> coordinatedList = service.getCoordinatedProjectList(partner);
            requestScope("coordinatedList", coordinatedList);
            
            List<Project> participatedList = service.getParticipatedProjectList(partner);
            requestScope("participatedList", participatedList);
            
            return forward("partner_presentation.jsp");
        }
        
        return null;
    }
}
